package com.hang.jvm.risc.v2_memory_bus;

import java.util.Arrays;

public class RegisterFile {
    private final long[] registers;

    public RegisterFile() {
        registers = new long[32];
        Arrays.fill(registers, 0L);
    }

    public long get(int index) {
        return registers[index];
    }

    public void set(int index, long value) {
        if (index > 0 && index < 32) {
            registers[index] = value;
        }

    }
}
